package edu.gatech.oad.OTConfig;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class SolaceCollestanTest {

	private Wagon wagon;
	private JourneyController JC;

	@Before
	public void setUp() throws Exception{
		wagon=Wagon.getWagon(new Settler("Settler0"), new Settler("Settler1"), new Settler("Settler3"), new Settler("Settler4"),
				Pace.Grueling, new Player("Player",Profession.BANKER), "Filling");

		JC=new JourneyController();
		Wagon.getInventoryController().getWagonInventory().get(Inventory.FOOD).setQuantity(50);
		JC.updateDistance();
	}
	
	@Test
	public void updateRationsTest(){
		
		//Filling case
		
		int current=Wagon.getInventoryController().getWagonInventory().get(Inventory.FOOD).getQuantity();
		JC.updateRations();
		assertEquals("Rations did not correctly subtract FILLING amount",current-JourneyController.FILLING,
				Wagon.getInventoryController().getWagonInventory().get(Inventory.FOOD).getQuantity());
		
		current=Wagon.getInventoryController().getWagonInventory().get(Inventory.FOOD).getQuantity();
		Wagon.setRation("Meager");
		JC.updateRations();
		assertEquals("Rations did not correctly subtract MEAGER amount",current-JourneyController.MEAGER,
				Wagon.getInventoryController().getWagonInventory().get(Inventory.FOOD).getQuantity());
		
		current=Wagon.getInventoryController().getWagonInventory().get(Inventory.FOOD).getQuantity();
		Wagon.setRation("Bare Bones");
		JC.updateRations();
		assertEquals("Rations did not correctly subtract BARE BONES amount",current-JourneyController.BARE_BONES,
				Wagon.getInventoryController().getWagonInventory().get(Inventory.FOOD).getQuantity());
	}
}
